<template>
  <div class="help">
    <van-tabs :active="active" @change="onChange">
      <van-tab title="商家投诉">
        <inputAlertShangJia></inputAlertShangJia>
        <imageUploader></imageUploader>
        <button class='eva_btn'>提交评价</button>
      </van-tab>
      <van-tab title="性能、意见反馈">
        <inputAlert></inputAlert>
        <imageUploader></imageUploader>
        <button class='eva_btn'>提交评价</button>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>

  import imageUploader from '../../components/imageUploader/imageUploader.vue'
  import inputAlert from '../../components/inputAlert/inputAlert.vue'
  import inputAlertShangJia from '../../components/inputAlertShangJia/inputAlert.vue'
export default {
  components: {
    imageUploader,
    inputAlert,
    inputAlertShangJia
  },
  data () {
    return {
      active: 1,
        value: "",
      fileList: [{
        isCion: true,
        isImage: false,
        cionSrc: "/static/images/icon/update.png",
        imgSrc: ""
      },
        {
          isCion: true,
          isImage: false,
          cionSrc: "/static/images/icon/update.png",
          imgSrc: ""
        }
        ]
      }
    },
  methods: {
    chooseImage (index) {
      var that = this;
      wx.chooseImage({
        count: 1,
        sizeType: ['original', 'compressed'],
        sourceType: ['album', 'camera'],
        success: function (res) {
          // console.log(res)
          wx.showToast({
            title: '正在上传',
            icon: 'loading',
            mask: true,
            duration: 1000
          })
          var tempFilePaths = res.tempFilePaths
          that.fileList[index].imgSrc = tempFilePaths
          that.fileList[index].isCion = false
          that.fileList[index].isImage = true
          console.log(tempFilePaths)
        }
      })
    }
  }

  }



</script>

<style lang="stylus" rel="stylesheet/stylus">
  .help
    background-color #eeeeee
    .fb_tips
      display flex
      flex-wrap wrap
      text
        width 30%
        padding 10rpx
        background-color #fff
        text-align center
        margin 20rpx 10rpx
    .fb_content
      background-color #fff
      margin-top 20rpx
      textarea
        padding 10rpx
    .form_btn_wrap
      margin-top 20rpx
      display flex
      justify-content flex-end
      button
        margin 0
        width 38%
        color #fff
        background-color var(--themeColor)

  .eva_btn
    width 600rpx
    height 80rpx
    line-height 80rpx
    font-size 30rpx
    color #fff
    background #1296DB
    position fixed
    left 75rpx
    bottom 37rpx
</style>
